home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-05-27 | 4.9 KB | 145 lines |
- // (c) Copyright 1994-1996 Microline Software, Inc. ALL RIGHTS RESERVED
- //
- // THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE COPIED AND USED
- // ONLY IN ACCORDANCE WITH THE TERMS OF THAT LICENSE AND WITH THE INCLUSION
- // OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE AND DOCUMENTATION, AND ITS
- // COPYRIGHTS ARE OWNED BY MICROLINE SOFTWARE AND ARE PROTECTED BY UNITED
- // STATES COPYRIGHT LAWS AND INTERNATIONAL TREATY PROVISIONS.
- //
- // THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
- // AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY MICROLINE SOFTWARE.
- //
- // THIS SOFTWARE AND REFERENCE MATERIALS ARE PROVIDED "AS IS" WITHOUT
- // WARRANTY AS TO THEIR PERFORMANCE, MERCHANTABILITY, FITNESS FOR ANY
- // PARTICULAR PURPOSE, OR AGAINST INFRINGEMENT. MICROLINE SOFTWARE
- // ASSUMES NO RESPONSIBILITY FOR THE USE OR INABILITY TO USE THIS
- // SOFTWARE.
- //
- // MICROLINE SOFTWARE SHALL NOT BE LIABLE FOR INDIRECT, SPECIAL OR
- // CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THIS PRODUCT. SOME
- // STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
- // CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS MIGHT NOT APPLY TO
- // YOU.
- //
- // MICROLINE SOFTWARE SHALL HAVE NO LIABILITY OR RESPONSIBILITY FOR SOFTWARE
- // ALTERED, MODIFIED, OR CONVERTED BY YOU OR A THIRD PARTY, DAMAGES
- // RESULTING FROM ACCIDENT, ABUSE OR MISAPPLICATION, OR FOR PROBLEMS DUE
- // TO THE MALFUNCTION OF YOUR EQUIPMENT OR SOFTWARE NOT SUPPLIED BY
- // MICROLINE SOFTWARE.
- //
- // U.S. GOVERNMENT RESTRICTED RIGHTS
- // This Software and documentation are provided with RESTRICTED RIGHTS.
- // Use, duplication or disclosure by the Government is subject to
- // restrictions as set forth in subparagraph (c)(1) of the Rights in
- // Technical Data and Computer Software Clause at DFARS 252.227-7013 or
- // subparagraphs (c)(1)(ii) and (2) of Commercial Computer Software -
- // Restricted Rights at 48 CFR 52.227-19, as applicable, supplier is
- // Microline Software, 41 Sutter St Suite 1374, San Francisco, CA 94104.
-
- import java.awt.*;
- import java.util.*;
- import java.mct.*;
- import java.applet.Applet;
-
- public class tree3 extends Applet
- {
- MlTree tree;
- static boolean expands[] = { true, true, true, false, false,
- false, true, false, false, true };
- static int levels[] = { 0, 1, 2, 3, 2, 2, 1, 2, 2, 2 };
- Image dotImage, winImage;
-
- public void init()
- {
- MlResources res;
- MlTreeRowDefinition rows[];
- int i, n;
-
- setLayout(new BorderLayout());
- res = new MlResources();
-
- makeIcons();
-
- tree = new MlTree();
-
- res.add("selectionPolicy", "SELECT_MULTIPLE_ROW");
- res.add("globalImageWidth", 16);
- res.add("globalImageHeight", 16);
- tree.setValues(res);
-
- n = 100;
- rows = new MlTreeRowDefinition[n];
- for (i = 0; i < n; i++)
- {
- rows[i] = new MlTreeRowDefinition();
- rows[i].level = levels[i % 10];
- if (i % 30 >= 10)
- rows[i].level += 3;
- if (i % 30 >= 20)
- rows[i].level += 3;
- rows[i].expands = expands[i % 10];
- if (rows[i].expands)
- rows[i].image = dotImage;
- else
- rows[i].image = winImage;
- rows[i].isExpanded = true;
- if (rows[i].expands)
- rows[i].string = "Sector Number " + rows[i].level + "-" +
- (i % 2) + (i + 413);
- else
- rows[i].string = "Item Number " + (i % 12) + (i % 3) + (i % 2);
- }
- tree.addRows(rows, 0);
-
- add("Center", tree);
- }
-
- public void makeIcons()
- {
- MlIconMaker im;
-
- im = new MlIconMaker();
- im.setDimensions(16, 16);
- im.setColor('B', 0xff000080);
- im.setColor('K', 0xff000000);
- im.setColor('G', 0xff808080);
-
- im.setPixels(" ");
- im.setPixels(" ");
- im.setPixels(" ");
- im.setPixels(" ");
- im.setPixels(" BBBBB ");
- im.setPixels(" BBBBBBB ");
- im.setPixels(" BBBBBBBBB ");
- im.setPixels(" BBB BBBBBB ");
- im.setPixels(" BBB BBBBBBB ");
- im.setPixels(" BBBBBBBBBBB ");
- im.setPixels(" BBBBBBBBBBB ");
- im.setPixels(" BBBBBBBBBBB ");
- im.setPixels(" BBBBBBBBB ");
- im.setPixels(" BBBBBBB ");
- im.setPixels(" BBBBB ");
- im.setPixels(" ");
- dotImage = im.createImage(this);
-
- im.clear();
- im.setPixels(" ");
- im.setPixels(" ");
- im.setPixels(" KKKKKKKKKKK ");
- im.setPixels(" KGGGGGGGGGK ");
- im.setPixels(" KG GK ");
- im.setPixels(" KG G GGG GK ");
- im.setPixels(" KG GK ");
- im.setPixels(" KG G GGG GK ");
- im.setPixels(" KG GK ");
- im.setPixels(" KGGGGGGGGGK ");
- im.setPixels(" KKKKKKKKKKK ");
- im.setPixels(" KGK ");
- im.setPixels(" KGK ");
- im.setPixels(" KKKKKKKKK ");
- im.setPixels(" KKKKKKKKK ");
- im.setPixels(" ");
- winImage = im.createImage(this);
- }
- }
-